using Net35.Xrm.Sdk.Discovery;
using System;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Description;
namespace Net35.Xrm.Sdk.Client
{
	internal sealed class DiscoveryServiceConfiguration : IServiceConfiguration<IDiscoveryService>, IWebAuthentication<IDiscoveryService>, IServiceManagement<IDiscoveryService>, IEndpointSwitch
	{
		private readonly ServiceConfiguration<IDiscoveryService> service;
		public event EventHandler<EndpointSwitchEventArgs> EndpointSwitched
		{
			add
			{
				this.service.EndpointSwitched += value;
			}
			remove
			{
				this.service.EndpointSwitched -= value;
			}
		}
		public event EventHandler<EndpointSwitchEventArgs> EndpointSwitchRequired
		{
			add
			{
				this.service.EndpointSwitchRequired += value;
			}
			remove
			{
				this.service.EndpointSwitchRequired -= value;
			}
		}
		public System.ServiceModel.Description.ServiceEndpoint CurrentServiceEndpoint
		{
			get
			{
				return this.service.CurrentServiceEndpoint;
			}
			set
			{
				this.service.CurrentServiceEndpoint = value;
			}
		}
		public IssuerEndpoint CurrentIssuer
		{
			get
			{
				return this.service.CurrentIssuer;
			}
			set
			{
				this.service.CurrentIssuer = value;
			}
		}
		public AuthenticationProviderType AuthenticationType
		{
			get
			{
				return this.service.AuthenticationType;
			}
		}
		public ServiceEndpointDictionary ServiceEndpoints
		{
			get
			{
				return this.service.ServiceEndpoints;
			}
		}
		public IssuerEndpointDictionary IssuerEndpoints
		{
			get
			{
				return this.service.IssuerEndpoints;
			}
		}
		public CrossRealmIssuerEndpointCollection CrossRealmIssuerEndpoints
		{
			get
			{
				return this.service.CrossRealmIssuerEndpoints;
			}
		}
		public PolicyConfiguration PolicyConfiguration
		{
			get
			{
				return this.service.PolicyConfiguration;
			}
		}
		public bool EndpointAutoSwitchEnabled
		{
			get
			{
				return this.service.EndpointAutoSwitchEnabled;
			}
			set
			{
				this.service.EndpointAutoSwitchEnabled = value;
			}
		}
		public System.Uri AlternateEndpoint
		{
			get
			{
				return this.service.AlternateEndpoint;
			}
		}
		public System.Uri PrimaryEndpoint
		{
			get
			{
				return this.service.PrimaryEndpoint;
			}
		}
		public bool IsPrimaryEndpoint
		{
			get
			{
				return this.service.IsPrimaryEndpoint;
			}
		}
		private DiscoveryServiceConfiguration()
		{
		}
		internal DiscoveryServiceConfiguration(System.Uri serviceUri)
		{
			this.service = new ServiceConfiguration<IDiscoveryService>(serviceUri, false);
		}
		public System.ServiceModel.ChannelFactory<IDiscoveryService> CreateChannelFactory()
		{
			return this.service.CreateChannelFactory(ClientAuthenticationType.Kerberos);
		}
		public System.ServiceModel.ChannelFactory<IDiscoveryService> CreateChannelFactory(ClientAuthenticationType clientAuthenticationType)
		{
			return this.service.CreateChannelFactory(clientAuthenticationType);
		}
		public System.ServiceModel.ChannelFactory<IDiscoveryService> CreateChannelFactory(System.ServiceModel.Description.ClientCredentials clientCredentials)
		{
			return this.service.CreateChannelFactory(clientCredentials);
		}
		public SecurityTokenResponse Authenticate(System.ServiceModel.Description.ClientCredentials clientCredentials)
		{
			return this.service.Authenticate(clientCredentials);
		}
		public SecurityTokenResponse Authenticate(System.IdentityModel.Tokens.SecurityToken securityToken)
		{
			return this.service.Authenticate(securityToken);
		}
		public SecurityTokenResponse AuthenticateCrossRealm(System.ServiceModel.Description.ClientCredentials clientCredentials, string appliesTo, System.Uri crossRealmSts)
		{
			return this.service.AuthenticateCrossRealm(clientCredentials, appliesTo, crossRealmSts);
		}
		public SecurityTokenResponse AuthenticateCrossRealm(System.IdentityModel.Tokens.SecurityToken securityToken, string appliesTo, System.Uri crossRealmSts)
		{
			return this.service.AuthenticateCrossRealm(securityToken, appliesTo, crossRealmSts);
		}
		public SecurityTokenResponse Authenticate(System.ServiceModel.Description.ClientCredentials clientCredentials, SecurityTokenResponse deviceSecurityTokenResponse)
		{
			return this.service.Authenticate(clientCredentials, deviceSecurityTokenResponse);
		}
		public SecurityTokenResponse AuthenticateDevice(System.ServiceModel.Description.ClientCredentials clientCredentials)
		{
			return this.service.AuthenticateDevice(clientCredentials);
		}
		public IdentityProvider GetIdentityProvider(string userPrincipalName)
		{
			return this.service.GetIdentityProvider(userPrincipalName);
		}
		public SecurityTokenResponse Authenticate(System.ServiceModel.Description.ClientCredentials clientCredentials, System.Uri uri, string keyType)
		{
			return this.service.Authenticate(clientCredentials, uri, keyType);
		}
		public SecurityTokenResponse Authenticate(System.IdentityModel.Tokens.SecurityToken securityToken, System.Uri uri, string keyType)
		{
			return this.service.Authenticate(securityToken, uri, keyType);
		}
		public AuthenticationCredentials Authenticate(AuthenticationCredentials authenticationCredentials)
		{
			return this.service.Authenticate(authenticationCredentials);
		}
		public void SwitchEndpoint()
		{
			this.service.SwitchEndpoint();
		}
		public bool HandleEndpointSwitch()
		{
			return this.service.HandleEndpointSwitch();
		}
		public bool CanSwitch(System.Uri currentUri)
		{
			return this.service.CanSwitch(currentUri);
		}
	}
}
